<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="BarrioCreateDlg" widgetVar="BarrioCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateBarrioTitle}">
            <h:form id="BarrioCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{barrioController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateBarrioLabel_id}" for="id" />
                        <p:inputText id="id" value="#{barrioController.selected.id}" title="#{bundle.CreateBarrioTitle_id}" required="false" requiredMessage="#{bundle.CreateBarrioRequiredMessage_id}"/>
                        <p:outputLabel value="#{bundle.CreateBarrioLabel_nombre}" for="nombre" />
                        <p:inputText id="nombre" value="#{barrioController.selected.nombre}" title="#{bundle.CreateBarrioTitle_nombre}" required="true" requiredMessage="#{bundle.CreateBarrioRequiredMessage_nombre}"/>
                        <p:outputLabel value="#{bundle.CreateBarrioLabel_direccionDeReferencia}" for="direccionDeReferencia" />
                        <p:inputText id="direccionDeReferencia" value="#{barrioController.selected.direccionDeReferencia}" title="#{bundle.CreateBarrioTitle_direccionDeReferencia}" />
                        <p:outputLabel value="#{bundle.CreateBarrioLabel_partidoId}" for="partidoId" />
                        <p:selectOneMenu id="partidoId" value="#{barrioController.selected.partidoId}" >
                            <f:selectItems value="#{partidoController.itemsAvailableSelectOne}"
                                           var="partidoIdItem"
                                           itemValue="#{partidoIdItem}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.CreateBarrioLabel_nomenclaturaOrigenId}" for="nomenclaturaOrigenId" />
                        <p:selectOneMenu id="nomenclaturaOrigenId" value="#{barrioController.selected.nomenclaturaOrigenId}" >
                            <f:selectItems value="#{nomenclaturaCatastralController.itemsAvailableSelectOne}"
                                           var="nomenclaturaOrigenIdItem"
                                           itemValue="#{nomenclaturaOrigenIdItem}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.CreateBarrioLabel_datoDelDominioId}" for="datoDelDominioId" />
                        <p:selectOneMenu id="datoDelDominioId" value="#{barrioController.selected.datoDelDominioId}" >
                            <f:selectItems value="#{datoDelDominioController.itemsAvailableSelectOne}"
                                           var="datoDelDominioIdItem"
                                           itemValue="#{datoDelDominioIdItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{barrioController.create}" value="#{bundle.Save}" update="display,:BarrioListForm:datalist,:growl" oncomplete="handleSubmit(args,'BarrioCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="BarrioCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
